package com.tianyang.yukuaifuzs.business.login.provider;

import android.content.Context;
import android.content.Intent;

import com.tianyang.yukuaifuzs.business.login.contract.LoginConfig;
import com.tianyang.yukuaifuzs.business.login.view.RegisterActivity;
import com.tianyang.yukuaifuzs.business.login.view.SetPasswordActivity;
import com.tianyang.yukuaifuzs.utils.IntentTool;

/**
 * Description：login模块内部跳转类
 * Created by xyj on 2024/3/7
 */
public class LoginOpenProvider {

    private static LoginOpenProvider instance;

    public static LoginOpenProvider getInstance() {
        if (instance == null) {
            synchronized (LoginOpenProvider.class) {
                if (instance == null) {
                    instance = new LoginOpenProvider();
                }
            }
        }
        return instance;
    }

    public void openRegisterActivity(Context context) {
        IntentTool.startActivity(context, RegisterActivity.class);
    }

    public void openForgotLoginPwdActivity(Context context) {
        Intent builder = new Intent(context, SetPasswordActivity.class);
        builder.putExtra(LoginConfig.PWD_TYPE, LoginConfig.FORGET_PWD);
        IntentTool.startActivity(context, builder);
    }

    public void openUpdateLoginPwdActivity(Context context) {
        Intent builder = new Intent(context, SetPasswordActivity.class);
        builder.putExtra(LoginConfig.PWD_TYPE, LoginConfig.UPDATE_PWD);
        IntentTool.startActivity(context, builder);
    }
}
